package com.fancy.learncenter.ui.activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.widget.ImageView;

import com.fancy.learncenter.R;
import com.fancy.learncenter.bean.ListenSpeakListDataBean;
import com.fancy.learncenter.ui.activity.base.BaseActivity;
import com.fancy.learncenter.ui.adapter.EverydayListenSpeekAdapter;
import com.fancy.learncenter.utils.FileUtils;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class CartoonExpandReadActivity extends BaseActivity {

    @Bind(R.id.back)
    ImageView back;
    @Bind(R.id.toolbar)
    Toolbar toolbar;
    @Bind(R.id.recyclerView)
    RecyclerView recyclerView;
    List<ListenSpeakListDataBean.ResultBean> list;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setCartoonContentView(R.layout.activity_cartoon_read_list, BaseActivity.Status.STATUS);
        ButterKnife.bind(this);
        initView();
    }

    private void initView() {
        list = new ArrayList<>();
        LinearLayoutManager manager = new LinearLayoutManager(this);
        manager.setOrientation(LinearLayoutManager.VERTICAL);
        recyclerView.setLayoutManager(manager);
        EverydayListenSpeekAdapter adapter = new EverydayListenSpeekAdapter(this, list, FileUtils.getReaderAudioPath());
        recyclerView.setAdapter(adapter);

    }


    @OnClick(R.id.my_Listen)
    public void onViewClicked() {
        Intent intent = new Intent(this, CartoonMyListenAndSpeakActivity.class);
        startActivity(intent);
    }
}
